package org.tongdao.yulong.factorybean;

import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;

import java.util.Map;

/**
 * @Description: TODO
 * @author: 殷玉龙
 * @date: 2021年01月11日 下午5:32
 */
public class BeanTypeAnnoApplication {
  public static void main(String[] args) {
    ApplicationContext ctx = new AnnotationConfigApplicationContext(BeanTypeConfiguration.class);
//    Toy bean = ctx.getBean(Toy.class);
//    System.out.println(bean);

//    Map<String, Toy> beansOfType = ctx.getBeansOfType(Toy.class);
//    beansOfType.forEach((name,toy) -> {
//      System.out.println(name + ":" + toy);
//    });
    System.out.println(ctx.getBean("&toyFactory"));
  }
}
